package com.movie.util;

import javax.swing.*;

public class ApiDocUtil {

     public static void showAdminApiDocument(JFrame parent) {
        String apiInfo = "<html><h2>AdminService API Documentation</h2>"
                + "<p><b>addMovie(Movie movie)</b>: 添加一部新电影</p>"
                + "<p><b>updateMovie(Movie movie)</b>: 更新电影信息</p>"
                + "<p><b>deleteMovie(String movieId)</b>: 删除一部电影</p>"
                + "<p><b>getAllMovies()</b>: 获取所有电影</p>"
                + "<p><b>addScreening(Screening screening)</b>: 添加一场放映场次</p>"
                + "<p><b>updateScreening(Screening screening)</b>: 更新放映场次信息</p>"
                + "<p><b>deleteScreening(String screeningId)</b>: 删除一场放映场次</p>"
                + "<p><b>getAllScreenings()</b>: 获取所有放映场次</p></html>";

        JOptionPane.showMessageDialog(parent,apiInfo,"Admin API Documentation",JOptionPane.INFORMATION_MESSAGE);
    }


    public static void showUserApiDocument(JFrame parent) {
        String apiInfo = "<html><h2>UserService API Documentation</h2>"
                + "<p><b>bookTicket(String screeningId, int seatNumber)</b>: 预定电影票</p>"
                + "<p><b>getMyTickets()</b>: 查看已预定电影票</p>"
                +  "<p><b>deleteTicket(String id)</b>: 删除电影票</p></html>";
        JOptionPane.showMessageDialog(parent,apiInfo,"User API Documentation",JOptionPane.INFORMATION_MESSAGE);
    }

       public static void showMovieApiDocument(JFrame parent) {
        String apiInfo = "<html><h2>MovieService API Documentation</h2>"
                + "<p><b>searchMovies(String keyword)</b>: 根据关键字搜索电影</p>"
                 + "<p><b>getScreeningsByMovie(String movieId)</b>: 根据电影 ID 获取放映场次</p>"
                + "<p><b>getScreeningById(String id)</b>: 根据放映场次 ID 获取放映场次</p>"
                  + "<p><b>updateScreening(Screening screening)</b>: 更新放映场次信息</p>"
                + "</html>";
        JOptionPane.showMessageDialog(parent,apiInfo,"Movie API Documentation",JOptionPane.INFORMATION_MESSAGE);
    }

}